<?php

/**
 * @see Zend_View_Helper_HtmlElement
 */
require_once 'Zend/View/Helper/HtmlElement.php';

/**
 * Image helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Tavs_View_Helper_HtmlImage extends Zend_View_Helper_HtmlElement
{
    /**
     * Gera o XHTML da imagem
     * 
     * @param string $src Caminho da imagem
     * @param array $attribs Atributos da imagem
     * @param bool $baseUrl Concatenar com baseUrl?
     * 
     * @return string
     */
	public function htmlImage($src, array $attribs = array(), $baseUrl = true)
	{
		if (true === (bool) $baseUrl) {
			$src = $this->view->baseUrl() . '/' . $src;
		}
		
		$attribs['src'] = $src;
		$xhtml = '<img ' . $this->_htmlAttribs($attribs) . $this->getClosingBracket();
		
		return $xhtml;
	}
	
}